<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2020/12/4
  Time: 19:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改学生成绩</title>
</head>
<body>
<div class="stuInfor_ViewDetails_tittle modal-header">
    <h4 class="modal-title" id="myModalLabel">学生成绩信息</h4>
</div>
<%--            修改学生成绩--%>

<div class="panel panel-default">
      <div class="panel-body">
        <a href="/excelPage?downPath=${downPath}" class="stuInfo_addBtn btn btn-info">返回</a>
        <form role="form" action="/update?downPath=${downPath}" method="post">
            <div class="form-group">
                <label>学生姓名:</label>
                <input type="text" class="form-control" name="name" id="seach">
            </div>
            <div id="tips" style="display: none"></div>
            <div class="form-group">
                <label>修改科目:</label>
                <select name="type">
                    <option value="1">语文</option>
                    <option value="2">数学</option>
                    <option value="3">英语</option>
                </select>
            </div>
            <div class="form-group">
                <label>修改成绩:</label>
                <input type="text" class="form-control" name="score">
            </div>
            <button type="submit" class="btn btn-success"><i class="glyphicon glyphicon-edit"></i> 修改</button>
            <button type="reset" class="btn btn-danger"><i class="glyphicon glyphicon-refresh"></i> 重置</button>
        </form>
        <h3 align="center"><span>${msg}</span></h3>
    </div>
</div>
<script src="../../static/lib/bootstrap-3.3.5-dist/js/jquery-1.11.3.js"></script>
<script src="../../static/lib/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<script src="../../static/js/DATE_index.js"></script>
<script src="../../static/js/authorityManage.js"></script>
</body>
</html>
<script type="text/javascript">
    $(function (){
        $("#seach").keyup(function (){
            var tips =$("#tips");
            if (this.value==null){
                return ;
            }
            $.ajax(
                {
                    url:"/ajaxUserName",
                    type:"post",
                    data:{"name":this.value},
                    success:function (data){
                        if (data.length>0 && data!=""){
                            var  html ="";
                            for (var i = 0; i < data.length; i++) {
                                html +="<div align='center'>"+"<img src="+"'"
                                    +data[i].uPath+"'"+ " id='imgId'/>"+ "<span style='cursor: pointer' onclick='writeContent(this)' onmouseover='changeBgColor(this)' onmouseout='trunBgColor(this)'>"
                                    +data[i].uName+
                                    "</span>"+"</div>";
                            }
                            tips.html(html);
                            tips.css("display","block")
                        }else {
                            return;
                        }
                    }
                }
            )
        });
    });
    function writeContent(div){
        var c = div.innerHTML;
        $("#seach").val(c);
        div.parentNode.style.display="none";
    }
    function changeBgColor(div){
        div.style.background="blue";
    }
    function trunBgColor(div){
        div.style.background="";
    }
</script>